//
//  EFPayDetailTypeCell.m
//  EnjogFood
//
//  Created by 王芳 on 17/5/14.
//  Copyright © 2017年 wf. All rights reserved.
//

#import "EFPayDetailTypeCell.h"
#import "EFOrderPayDetailItem.h"

@interface EFPayDetailTypeCell ()
@property (strong, nonatomic) UILabel *typeTipLabel;
@property (strong, nonatomic) UILabel *typeLabel;
@end

@implementation EFPayDetailTypeCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self initUI];
    }
    return self;
}

- (void)initUI{
    [self.contentView addSubview:self.typeTipLabel];
    [self.contentView addSubview:self.typeLabel];
}

- (void)setObject:(EFOrderPayDetailItem *)item{
    self.typeTipLabel.text = item.leftStr;
    [self.typeTipLabel sizeToFit];
    self.typeTipLabel.left = 20;
    self.typeTipLabel.top = 6;
    
    self.typeLabel.text = item.rightStr;
    [self.typeLabel sizeToFit];
    self.typeLabel.right = kScreenWidth - 20;
}

- (UILabel *)typeTipLabel{
    if (!_typeTipLabel) {
        _typeTipLabel = [[UILabel alloc] init];
        _typeTipLabel.font = [UIFont systemFontOfSize:13];
        _typeTipLabel.textColor = kBlack999;
    }
    return _typeTipLabel;
}

- (UILabel *)typeLabel{
    if (!_typeLabel) {
        _typeLabel = [[UILabel alloc] init];
        _typeLabel.font = [UIFont systemFontOfSize:13];
        _typeLabel.textColor = kBlack333;
    }
    return _typeLabel;
}

@end
